/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package frc2856.robot;

/**
 *
 * @author DDDoss
 */
public class Utils {
   
    public static String[] stringSplit(String s, char c){
        String[] splitStrings;
        int num = 0;
        int length = s.length();
        int start = 0;
        while(start!=-1){
            start = s.indexOf(c, start+1);
            num++;
            if(start ==  length-1){
                s = s.substring(0, length-1);
                num--;
                length--;
            }
        }
        start = -1;
        splitStrings = new String[num];
        for(int i = 0;  i<num-1; i++){
            int newStart = s.indexOf(c, start+1);
            splitStrings[i] = s.substring(start+1, newStart);
            start  = newStart;
        }
        splitStrings[num-1] = s.substring(start+1, length);
        
        return splitStrings;
    }
}
